﻿<title>互动</title>
<link type="text/css" href="${ctx}/resources/css/ace.min.1.css"  rel="stylesheet" />
<table>
<tr>
<th>互动标签:</th>
	<th width="70px;" class="label label-sm label-light arrowed"><a href="${ctx}/admin/interact/list${suffix}">不限</a></th>
	<#assign sTypes = dicSetting.getParameterMap("interact.type")> 
<!--	<#list sTypes?keys as key>
		<#if key_index lt 10>
			<th width="70px;" class="label label-sm label-warning arrowed"><a href="${ctx}/admin/interact/list${suffix}?type=${key}">${sTypes[key]}</a></th>
		</#if>
	</#list>-->
</tr>
</table>

<div class="hr hr-5"></div>
<div class="row">
	<div class="col-xs-12">
		<div class="table-responsive">
			<table id="sample-table-1" class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>ID</th>
						<th>积分礼品名称</th>
						<th>图片</th>
						<th>兑换积分值</th>
						<th>原价</th>
						<th>库存数量</th>
						<th>礼品详情</th>
						<th>详情图片</th>
						<th>首页图片</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				<#list pager.itemList as u>
					<tr>
						<td>${u.id!}</td>
						<td>${u.name}</td>
						<td>
							<#list gsonUtils.getImgsJsonList(u.urlList)! as url>
								<span class="profile-picture">
									<img style="height:105px;width:250px;" class="editable img-responsive" src="${tagUtils.getFileFullPath(url)}" />
								</span>
								<#break>
							</#list>
						</td>
							<td>${u.convert!}</td>
							<td>${u.price!}</td>
							<td>${u.stock!}</td>
							<td>${u.info!}</td>
						<td>
							<#list gsonUtils.getImgsJsonList(u.detList)! as url>
								<span class="profile-picture">
									<img style="height:105px;width:250px;" class="editable img-responsive" src="${tagUtils.getFileFullPath(url)}" />
								</span>
								<#break>
							</#list>
						</td>
						<td>
								<#if u.id==1>
							<#list gsonUtils.getImgsJsonList(u.logoUrl)! as url>
								<span class="profile-picture">
									<img style="height:105px;width:250px;" class="editable img-responsive" src="${tagUtils.getFileFullPath(url)}" />
								</span>
								<#break>
							</#list>
								</#if>
						</td>
				
							
							<td>
								<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
										<a class="green" href="${ctx}/admin/convert/edit-${u.id}${suffix}" alt="编辑">
											<i class="icon-pencil bigger-130" title="编辑"></i>
										</a>
									
									<a class="red" onclick="isDel('${ctx}/admin/convert/delete-${u.id}${suffix}')" alt="Delete">
										<i class="icon-trash bigger-130" title="删除"></i> 
									</a>
								</div>
							</td>
					</tr>
				</#list>
				</tbody>
			</table>
		</div>
	
		<div class="hr hr-18 dotted hr-double"></div>
		<@h.page pager=pager action="${ctx}/admin/convert/list${suffix}" />
	</div><!-- /span -->
</div><!-- /row -->

<#if errorMsg??>
	<div class="hr hr-18 hr-double dotted"></div>
	<h4 class="lighter">
		<i class="icon-hand-right icon-animated-hand-pointer red"></i>
		<span class="pink">${errorMsg!}</span>
	</h4>
</#if>

<#if infoMsg??>
	<div class="hr hr-18 hr-double dotted"></div>
	<h4 class="lighter">
		<i class="icon-hand-right icon-animated-hand-pointer green"></i>
		<span class="pink">${infoMsg}</span>
	</h4>
</#if>

<script>
function isDel(url){
		if(!confirm("确认要删除？")){ 
				return false;		
		}else{
			location.href = url;
		}
	}
$(document).ready(function(){
	RP.addBreadcrumb([ {name:"互动列表", active: true}]);
	$("#breadcrumbs ul").append('&nbsp;&nbsp;&nbsp;&nbsp;<a href="${ctx}/admin/convert/add${suffix}"><i class="icon-zoom-in"></i><span class="label label-warning arrowed-in arrowed-in arrowed-right">新增</span></a>');
});
function doUserState(checkbox,id) {
		if(checkbox.checked) {
			$.ajax({
			async : false,
	        cache : false,
	        type : 'POST',
	        dataType :JSON,
	        url : "${ctx}/admin/convert/on?id="+id,
	        error : function(data){
	        	var str = data.responseText;
	        	if(str.indexOf("true")>0){
    				location.href = location.href;
    			}else{
    			}
	        }
			});
		} else {
			$.ajax({
			async : false,
	        cache : false,
	        type : 'POST',
	        dataType :JSON,
	        url : "${ctx}/admin/convert/off?id="+id,
	        error : function(data){
	        	var str = data.responseText;
	        	if(str.indexOf("true")>0){
    				location.href = location.href;
    			}else{
    			}
	        }
			});
		}
	}
</script>